/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package client;

import Buffer.Flight;
import Buffer.FlightData;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Toshiba
 */
public class OffChecking implements Runnable{

    FlightData FlightData;
    
    public OffChecking(FlightData flightdata)
    {
        this.FlightData = flightdata;
    }

    public void run() {
        Calendar now;
        while (true)
        {
            now = Calendar.getInstance();
            synchronized(FlightData)
            {
                System.out.println("off checking..");
                System.out.println("time now : " + now.getTimeInMillis()/(1000));
                FlightData.OffCheck();
            }

            //Sleep for 0.5 minutes
            try {
                Thread.sleep(30000);
            } catch (InterruptedException ex) {
                Logger.getLogger(OffChecking.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }


}
